package com.idealighter.game.games.texaspoker.struct;

/**
 * Created . by Administrator on 2015/10/28.
 */
public enum BettingDecision {
  /**
   * 跟注.
   */
  CALL(0, "跟注"),
  /**
   * 弃牌.
   */
  FOLD(1, "弃牌"),
  /**
   * 加注.
   */
  RAISE(2, "加注"),
  /**
   * 梭哈.
   */
  ALL_IN(3, "梭哈"),
  /**
   * 让牌.
   */
  CHECK(4, "让牌");

  public final int type;
  public final String desc;

  BettingDecision(int type, String desc) {
    this.type = type;
    this.desc = desc;
  }

  /**
   * 获取下注类型.
   * 
   * @param type 下注类型.
   * @return
   */
  public static BettingDecision getBettingType(int type) {
    for (BettingDecision betType : BettingDecision.values()) {
      if (betType.type == type) {
        return betType;
      }
    }
    return null;
  }

  @Override
  public String toString() {

    return name() + "(" + desc + ")";
  }
}
